package cn.edu.zut.internship.entity;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 页面标签
 */
public class AuthSysMenuMeta implements Serializable {
    /**
     *节点id
     */
    private Long id;
    /**
     * 节点名称
     */
    private String title;
    /**
     * 节点图标
     */
    private String icon;
    /**
     *页面是否不要缓存，缺省为false
     */
    private Short noCache;
    /**
     * 标签页面是否总是显示（不能关闭）
     */
    private Short affix;
    /**
     * 缺省true，是否以面包屑显示页面
     */
    private Short breadcrumb;
    /**
     * 在左边菜单上高亮显示
     */
    private String activeMenu;

    private Long mnId;
    /**
     * 允许路由的角色列表
     */
    private List<Long> roles;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon == null ? null : icon.trim();
    }

    public Short getNoCache() {
        return noCache;
    }

    public void setNoCache(Short noCache) {
        this.noCache = noCache;
    }

    public Short getAffix() {
        return affix;
    }

    public void setAffix(Short affix) {
        this.affix = affix;
    }

    public Short getBreadcrumb() {
        return breadcrumb;
    }

    public void setBreadcrumb(Short breadcrumb) {
        this.breadcrumb = breadcrumb;
    }

    public String getActiveMenu() {
        return activeMenu;
    }

    public void setActiveMenu(String activeMenu) {
        this.activeMenu = activeMenu == null ? null : activeMenu.trim();
    }

    public Long getMnId() {
        return mnId;
    }

    public void setMnId(Long mnId) {
        this.mnId = mnId;
    }



    private List<AuthSysRole> roleList;

    public List<Long> getRoles() {
        if(this.roleList != null){
            this.roles = new ArrayList<>();
            for(AuthSysRole role:roleList){
                this.roles.add(role.getRlId());
            }
        }
        return roles;
    }

    public void setRoles(List<Long> roles) {
        this.roles = roles;
    }

    public List<AuthSysRole> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<AuthSysRole> roleList) {
        this.roleList = roleList;
    }
}